@(title: String, repository: Option[gitbucket.core.service.RepositoryService.RepositoryInfo] = None)(body: Html)(implicit context: gitbucket.core.controller.Context)
@import gitbucket.core.plugin.PluginRegistry
@import gitbucket.core.servlet.AutoUpdate
@import context._
@import gitbucket.core.view.helpers._
<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>@title</title>
    <link rel="icon" href="@assets/common/images/gitbucket.png" type="image/vnd.microsoft.icon" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="@assets/vendors/bootstrap/css/bootstrap.css" rel="stylesheet">
    <link href="@assets/vendors/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
    <link href="@assets/vendors/datepicker/css/datepicker.css" rel="stylesheet">
    <link href="@assets/vendors/colorpicker/css/bootstrap-colorpicker.css" rel="stylesheet">
    <link href="@assets/vendors/google-code-prettify/prettify.css" type="text/css" rel="stylesheet"/>
    <link href="@assets/vendors/facebox/facebox.css" rel="stylesheet"/>
    <link href="@assets/common/css/gitbucket.css" rel="stylesheet">
    <script src="@assets/vendors/jquery/jquery-1.9.1.js"></script>
    <script src="@assets/vendors/dropzone/dropzone.js"></script>
    <script src="@assets/common/js/validation.js"></script>
    <script src="@assets/common/js/gitbucket.js"></script>
    <script src="@assets/vendors/bootstrap/js/bootstrap.js"></script>
    <script src="@assets/vendors/datepicker/js/bootstrap-datepicker.js"></script>
    <script src="@assets/vendors/colorpicker/js/bootstrap-colorpicker.js"></script>
    <script src="@assets/vendors/google-code-prettify/prettify.js"></script>
    <script src="@assets/vendors/zclip/ZeroClipboard.min.js"></script>
    <script src="@assets/vendors/elastic/jquery.elastic.source.js"></script>
    <script src="@assets/vendors/facebox/facebox.js"></script>
  </head>
  <body>
    <form id="search" action="@path/search" method="POST">
      <div class="navbar">
        <div class="navbar-inner">
          <div class="container">
            <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
              <span class="icon-bar"></span>
            </button>
            <a class="brand" href="@path/">
              <img src="@assets/common/images/gitbucket.png" style="width: 24px; height: 24px;"/>GitBucket
              @defining(AutoUpdate.getCurrentVersion){ version =>
                <span class="header-version">@version.majorVersion.@version.minorVersion</span>
              }
            </a>
            <div class="nav-collapse collapse pull-right header-menu">
              @repository.map { repository =>
                <input type="text" name="query" style="width: 300px; margin-bottom: 0px;" placeholder="Search this repository"/>
                <input type="hidden" name="owner" value="@repository.owner"/>
                <input type="hidden" name="repository" value="@repository.name"/>
              }
              @if(loginAccount.isDefined){
                <a href="@url(loginAccount.get.userName)" class="username menu">@avatar(loginAccount.get.userName, 20) @loginAccount.get.userName</a>
                <a class="dropdown-toggle menu" data-toggle="dropdown" href="#"><i class="icon-plus"></i><span class="caret" style="vertical-align: middle;"></span></a>
                <ul class="dropdown-menu">
                  <li><a href="@path/new">New repository</a></li>
                  <li><a href="@path/groups/new">New group</a></li>
                </ul>
                <a href="@url(loginAccount.get.userName)/_edit" class="menu" data-toggle="tooltip" data-placement="bottom" title="Account settings"><i class="icon-user"></i></a>
                @if(loginAccount.get.isAdmin){
                  <a href="@path/admin/users" class="menu" data-toggle="tooltip" data-placement="bottom" title="Administration"><i class="icon-wrench"></i></a>
                }
                <a href="@path/signout" class="menu-last" data-toggle="tooltip" data-placement="bottom" title="Sign out"><i class="icon-share-alt"></i></a>
              } else {
                <a href="@path/signin?redirect=@urlEncode(currentPath)" class="btn btn-last" id="signin">Sign in</a>
              }
            </div><!--/.nav-collapse -->
          </div>
        </div>
      </div>
    </form>
    @body
    <script>
      $(function(){
        $('#search').submit(function(){
          return $.trim($(this).find('input[name=query]').val()) != '';
        });
      });
    </script>
    @PluginRegistry().getJavaScript(request.getRequestURI).map { script =>
      <script>
        @Html(script)
      </script>
    }
  </body>
</html>
